package com.dzl.exchange.service.impl;

import com.dzl.base.service.BaseServiceImpl;
import com.dzl.exchange.dao.WelfareExchangeMealGoodsMapper;
import com.dzl.exchange.pojo.WelfareExchangeMealGoods;
import com.dzl.exchange.pojo.vo.ExchangeSkuGoodsVo;
import com.dzl.exchange.service.WelfareExchangeMealGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * 兑换券套餐商品表(WelfareExchangeMealGoods)表服务实现类
 * @author caobucao
 * @date 2021-07-09 17:30:09
 */
@Service
public class WelfareExchangeMealGoodsServiceImpl extends BaseServiceImpl<WelfareExchangeMealGoods> implements WelfareExchangeMealGoodsService {

    @Autowired
    private WelfareExchangeMealGoodsMapper mapper;

    @Override
    public Integer updateExchangeGoodsDisplayPrice(Integer exchangeGoodsId, BigDecimal displayPrice){
        WelfareExchangeMealGoods welfareExchangeGoods = new WelfareExchangeMealGoods();
        welfareExchangeGoods.setDisplayPrice(displayPrice);
        welfareExchangeGoods.setId(exchangeGoodsId);
        return mapper.updateByPrimaryKeySelective(welfareExchangeGoods);
    }

    @Override
    public Integer deleteByMealIds(List<Integer> mealIds) {
        return mapper.deleteByMealIds(mealIds);
    }

    @Override
    public List<ExchangeSkuGoodsVo> selectExchangeSkuGoodsVoByMealId(Integer mealId) {
        return mapper.selectExchangeSkuGoodsVoByMealId(mealId);
    }
}
